package com.dao;

import com.entity.FootprintItem;

import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface FootprintDao {
  /**
   * 获取某个用户的足迹数量
   *
   * @param userId 用户编号
   * @return 足迹数量
   */
  int selectFootprintCount(@Param("userId") String userId);

  List<FootprintItem> selectFootprintList(
      @Param("userId") String userId, @Param("startIndex") int startIndex, @Param("num") int num);

  int deleteFootprintItem(@Param("userId") String userId, @Param("visitTime") String visitTime);

  int insertFootprintItem(@Param("userId") String userId, @Param("goodId") String goodId);

  /**
   * 删除较远的记录只保留最近的retainCount条
   *
   * @return
   */
  int deleteOldRecord(@Param("retainCount") int retainCount);

  List<Map<String, Object>> selectFootprint(@Param("userId") String userId);
}
